Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add letter spacing support for svg #3718

Merged
merged 5 commits into from
Apr 1, 2018
Merged

Conversation

AvaelKross
Copy link
Contributor

This adds a support for letter spacing in exported svg files. Also I fixed the parser to set charSpacing according to letter-spacing css rule. I have no time to make sure test works, so please feel free to improve it. I tested it manually for iText, and it works like a charm and keeps positioning very accurately.

@AvaelKross AvaelKross mentioned this pull request Feb 19, 2017
@asturur
Copy link
Member

asturur commented Feb 19, 2017

i did not even know letter-spacing was a SVG thing.

I have to check the SVG export, but looks good overall

@asturur
Copy link
Member

asturur commented Feb 19, 2017

image

this Canvas text can be actually be exported like this in the SVG

image

how your changes will influence the Itext export? can you post some simple screenshot?

@AvaelKross
Copy link
Contributor Author

AvaelKross commented Feb 20, 2017

hmm.. this is a sample itext object on canvas:
2017-02-20 7 27 27
and this is an svg version:
2017-02-20 7 30 09
(ignore sizing etc., these were just differently cropped)

@asturur
Copy link
Member

asturur commented Feb 20, 2017

i guess the itext code needs to be cleared from the actual charspacing code and left your one

@asturur
Copy link
Member

asturur commented Apr 24, 2017

i think this has been solved with latest master. Anyway since the new text changes, the svg ouput must be handled differently

@asturur
Copy link
Member

asturur commented Apr 1, 2018

@AvaelKross more than one year passed, but @brentcappello made me notice today that here there was some unmerged work. So i cleaned it up and merge it.

@asturur asturur merged commit addea82 into fabricjs:master Apr 1, 2018
@asturur asturur mentioned this pull request Apr 2, 2018
@asturur asturur mentioned this pull request May 8, 2018
thiagocunha pushed a commit to thiagocunha/fabric.js that referenced this pull request Nov 18, 2019
* add letter spacing support for svg

* fix letter spacing for Parser

* Update itext.svg_export.js

* Update text.class.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants